<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="/common/taglibs.jsp"%>
<%@include file="/common/meta.jsp"%>
<title>修改资源</title>
</head>
<body>
	
	<form id="resourceForm" action="<c:url value='/pf/resource/mResource'/>" method="post" autocomplete="off">
		<input type="hidden" name="id" value="${resource.id }"/>
		<input type="hidden" name="resourceParentId" value="${resource.resourceParentId }"/>
		<table class="add_form">
			<tr>
				<td align="right" width="35%">
					<label>资源名称:</label>
				</td>
				<td width="70%">
					<input name="resourceName" class="add_input" value="${resource.resourceName }" required/>
				</td>
			</tr>
			<tr>
				<td align="right">
					<label>上级资源名称:</label>
				</td>
				<td>
					<c:out value="${resource.resourceParentName }"/>
				</td>
			</tr>
			<tr>
				<td align="right">
					<label>资源地址:</label>
				</td>
				<td>
					<input name="resourceUrl" class="add_input" value="${resource.resourceUrl }" required/>
				</td>
			</tr>
			<tr>
				<td align="right">
					<label>资源图标地址:</label>
				</td>
				<td>
					<input name="resourceIcon" class="add_input" value="${resource.resourceIcon }" required/>
				</td>
			</tr>
			<tr>
				<td align="right">
					<label>是否有效:</label>
				</td>
				<td>
					<input type="radio" <c:if test="${'1' == resource.resourceIsvalid}">checked="checked"</c:if> name="resourceIsvalid" value="1" />有效
					<input type="radio" <c:if test="${'0' == resource.resourceIsvalid}">checked="checked"</c:if> name="resourceIsvalid" value="0"/>无效
				</td>
			</tr>
			<tr>
				<td align="right">
					<label>排序值:</label>
				</td>
				<td>
					<input name="resourceOrderno" class="add_input" value="${resource.resourceOrderno }" required/>
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<input id="submit" type="button" value="保存"/>
				</td>
			</tr>
		</table>
	</form>
	
	<script type="text/javascript">
		$(function() {
			var ajax_option = {
				success:function(data, status, xhf) {
					if("success" == status) {
						//关闭窗口，刷新父页面
						parent.closeAndRefresh();
					} else {
						art.dialog.alert(data.msg);
					}
				}
			};
			$("#resourceForm").ajaxForm();
			$("#submit").click(function() {
				if($("#resourceForm").valid()) {
					$("#resourceForm").ajaxSubmit(ajax_option);
				}
			});
		});
	</script>
</body>
</html>